Test Programs: .def flags = r00 .def hexLow = r08 .def hexHigh = r09 .def decPoint = r0a .def ledLow = r0c .def ledHigh = r0d .def swLow = r0c .def swHigh = r0d ;Program 1 ;Set registers to predetermined value. .org 0x0000 ldi aa,ledLow ldi 55,ledHigh ldi aa,hexLow ldi 55,hexHigh ;Program 2 ;Turn on each LED whose switch is on. .org 0x0000 loop: mov swLow, ledLow mov swLow, hexLow mov swHigh, ledHigh mov swHigh, hexHigh jmp loop ;Program 3 ;If r10 == r11 turn ledLow on. If r10 == r12 turn ledHigh on. .org 0x0000 ldi aa,r10 ldi 55,r11 ldi aa,r12 cmp r10,r11 breq led0 check: cmp r10,r12 breq led1 loop: jmp loop led0: ldi FF,ledLow jmp check led1: ldi FF,ledHigh jmp loop ;Program 4 ;If swLow == swHigh then turn dps on. .org 0x0000 loop: mov swLow,ledLow mov swHigh,ledHigh mov swLow,hexLow mov swHigh,hexHigh cmp swLow,swHigh breq dpOn jmp dpOff dpOn: ldi 0F,decPoint jmp loop dpOff: ldi 00,decPoint jmp loop ;Program 5 ;Load byte from memory, write to that address and then read it again. .def reg = r10 .def memL = r11 .def memH = r12 .org 0x0000 ldi c3,reg ldi LOW(memByte),memL ldi HIGH(memByte),memH ld memL,ledLow st reg,memL ld memL,ledHigh loop: jmp loop memByte: .byte 8b